package com.rtp.transformer.parser.model;

import java.util.List;
/**
 * The pattern to fill with portion node in husband config file
 * include FormatField list
 * @author xueming
 *
 */
public class FormatPortion implements Comparable{
	
	private String id;
	private int distance;
	private int gap;
	private boolean begin;
	private int priority;
	private List<FormatField> fields;	
	
	public List<FormatField> getFields() {
		return fields;
	}
	public void setFields(List<FormatField> fields) {
		this.fields = fields;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	 
	public int getDistance() {
		return distance;
	}
	public void setDistance(int distance) {
		this.distance = distance;
	}
	
	
	 
	 
	public FormatPortion(String id, int distance, int gap, boolean begin,
			List<FormatField> fields) {
		super();
		this.id = id;
		this.distance = distance;
		this.gap = gap;
		this.begin = begin;
		this.fields = fields;
	}
	public boolean isBegin() {
		return begin;
	}
	public void setBegin(boolean begin) {
		this.begin = begin;
	}
	public int getGap() {
		return gap;
	}
	public void setGap(int gap) {
		this.gap = gap;
	}
	
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public int compareTo(Object o) {
		FormatPortion fp = (FormatPortion)o;
		if(fp.getPriority()>this.priority)
			return 1;
		else
			return -1;
	}
	
	
}
